from django.utils.deprecation import MiddlewareMixin


# # 自己处理跨域，跟web框架无关
# class CorsMiddle(MiddlewareMixin):
#     def process_response(self, request, response):
#         if request.method == 'OPTIONS':
#             response['Access-Control-Allow-Headers'] = '*'
#             response['Access-Control-Allow-Methods'] = '*'
#         # 在响应头中加入Access-Control-Allow-Origin,处理了简单请求
#         response['Access-Control-Allow-Origin'] = '*'
#         # 处理非简单请求
#         return response
